This invention relates to encoding a stream of source characters into a shorter stream of codewords and decoding the codewords.
Different source characters may appear with different frequencies in a stream of source characters. Encoding more frequently appearing source characters as shorter codewords can reduce the length of the stream of codewords. The relative frequencies of appearance of different source characters can change over time.